/**
 * 
 */
package com.mustafaiev.tair.autobase.web.command;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Tair Mustafaiev
 * 
 */
public class DriverListCommand implements AutobaseServletCommand {

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.mustafaiev.tair.autobase.web.command.AutobaseServletCommand#processGet
     * (javax.servlet.http.HttpServletRequest,
     * javax.servlet.http.HttpServletResponse)
     */
    @Override
    public void processGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {

        if (req.getRequestURI().equals("/admin/drivers.do")) {
            req.setAttribute("page", "drivers");
            req.getSession().getServletContext().getRequestDispatcher("/admin/index.jsp")
                    .forward(req, resp);
        } else {
            resp.sendRedirect("/admin.do");
        }

    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.mustafaiev.tair.autobase.web.command.AutobaseServletCommand#processPost
     * (javax.servlet.http.HttpServletRequest,
     * javax.servlet.http.HttpServletResponse)
     */
    @Override
    public void processPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        // TODO Auto-generated method stub

    }

}
